package com.example.oj.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.oj.entity.SysOption;
import com.example.oj.service.SysOptionService;
import com.example.oj.mapper.SysOptionMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
* @author mingjianyun
* @description 针对表【sys_option】的数据库操作Service实现
* @createDate 2024-03-11 20:38:57
*/
@Service
public class SysOptionServiceImpl extends ServiceImpl<SysOptionMapper, SysOption>
    implements SysOptionService{

  @Resource
  private SysOptionMapper sysOptionMapper;

  @Override
  public List<Map<String, Object>> getOptionsList(String type) {
    return sysOptionMapper.getOptionsList(type);
  }

    @Override
    public List<SysOption> getOptionsListByType(String type) {
      QueryWrapper<SysOption> queryWrapper = new QueryWrapper<>();
      queryWrapper.eq("type",type);
      return sysOptionMapper.selectList(queryWrapper);
    }

}




